package com.bdqn.newdream.service.Impl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.ui.Model;
import org.springframework.web.multipart.MultipartFile;

import com.bdqn.newdream.javabean.AProblem;
import com.bdqn.newdream.javabean.DreamingUser;
import com.bdqn.newdream.javabean.Imgjson;
import com.bdqn.newdream.javabean.Problemlist;
import com.bdqn.newdream.javabean.ReComment;
import com.bdqn.newdream.pojo.Comment;
import com.bdqn.newdream.pojo.Dreamuser;
import com.bdqn.newdream.pojo.Like;
import com.bdqn.newdream.pojo.Message;
import com.bdqn.newdream.pojo.Problem;

public interface DreamuserServiceImpl {
	/*
	 * (测试)
	 * @see com.bdqn.newdream.service.Impl.DreamuserServiceImpl#getdreamuser()
	 */
	List<Dreamuser> getdreamuser();
	/*
	 * 保存图片
	 * (Service保存图片，富文本域使用)
	 * @see com.bdqn.newdream.service.Impl.DreamuserServiceImpl#getImgjson(org.springframework.web.multipart.MultipartFile)
	 */
	Imgjson saveImgjson(MultipartFile file,HttpServletRequest request);
	/*
	 * 
	 * (Service查询main页面需要问题列表返回List集合)
	 * @see com.bdqn.newdream.service.Impl.DreamuserServiceImpl#getProblemlist(java.lang.Integer)
	 */
	List <Problemlist> getProblemlist(Integer id,Integer uid,Integer page);
	/*
	 * (Service层登陆验证)
	 * @see com.bdqn.newdream.service.Impl.DreamuserServiceImpl#loginuser(java.lang.String, java.lang.String)
	 */
	DreamingUser loginuser(String name,String pwd);
	
	List <Problemlist> problemlist(Integer id,Integer page);
	 /*
	  * 统计问题总页
	  */
	Integer countProblem();
	/*
	 * 保存用户发表的问题
	 */
	Integer saveProblem(Problem problem);
	
	void loadmain(HttpSession session,Model model,Integer page);
	
	AProblem selectAProblem(Integer id,Integer uid);
	
	AProblem selectAProblem(Integer id);
	
	Comment doem();
	
	Integer deleteByindividuation(Integer id);
	
	/**
	 * 
	 */
	Integer insertindividuation(Integer pid,Integer uid);
	
	Integer delectAProbleam(Integer id);
	
	Integer selectsaveiid(Integer uid,Integer pid);
	
	Integer selectsavecollect(Integer uid,Integer pid);
	
	Integer selectcid(Integer uid,Integer pid);
	
	Integer dropcollect(Integer id);
	
	Integer dropcomment(Integer id);
	
	Integer savecomment(Integer uid,Integer pid,String text,Integer state);
	
	Integer saveaccept(Integer pid,Integer cid);
	
	Integer selectaccept(Integer pid,Integer cid);
	
	int saveLike(Integer cid,Integer uid);
	
	Integer selectlikeid(Integer cid,Integer uid);
	
	Integer dorplike(Integer cid,Integer uid);
	
	Integer addnum(Integer id);
	
	List<Problem> Firstnum(Integer id);
	
	List<Problemlist> Firstcount(Integer id);
	
	Integer countlikep(String title);
	
	List<Problemlist> likeprobleam(String title,Integer page);
	
	String sendkey(String username);
	
	Integer updatepass(String username,String pass,String key);
	
	void updatekey(String username);
	
	boolean selectemail(String email);
	
	
	String newdream(Dreamuser user,Message message1,Model model,HttpServletRequest request);
	
	Integer activate(String key);
	
	DreamingUser gomessage(Integer id);
	
	Integer updateByPrimaryKey(Message message);
	
	String saveImg(MultipartFile file,HttpServletRequest request);
	
	Dreamuser selectByPrimaryKey(Integer id);
	
	boolean senduser(String title,String text,String email);
}
